class Point
{
    constructor(x,y){
        this.x = x;
        this.y = y;
    }
    
    getPosition()
    {
        return `(${this.x},${this.y})`
    }

    static getClassName()
    {
        // reutrn Point.name;
    }
}


const p1 = new Point(1,2);
console.log(p1.getPosition(),Point.getClassName());



// var info = {
//     _age:18,
//     set age(newValue){
//         console.log("new age is:",newValue);
//         if(newValue > 18)
//         {
//             console.log("比较大");

//         }
//         else
//             console.log("还年轻");
//     },

//     get age(){
//         console.log("多大了?");
//         return this._age;
//     }
// }

// console.log(info.age);
// info.age = 17;
// info.age = 19;


class info{
    constructor(age)
    {
        this._age = age;
    }

    set age(newAge)
    {
        this._age = newAge;
    }

    get age()
    {
        return this._age;
    }

}

var info1 = new info(12);
info1.age = 12;
info1.age = 20;
console.log(info1.age);
